from Base.Base import Base
from selenium.webdriver.common.by import By
import time



class Page(Base):

    # 点击登录
    click_login_loc = (By.XPATH, '/html/body/div[1]/div/section/aside/ul/li/ul/li[13]')
    def click_login(self):
        self.click(self.click_login_loc)

    # 输入用户名
    send_username_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/div/div[2]/div[1]/div/input')
    def send_username(self):
        self.send_keys(self.send_username_loc, 'zhangsan')

    # 输入密码
    send_password_loc = (By.XPATH, '//html/body/div[1]/div/section/section/main/div/div[2]/div[2]/div/input')

    def send_password(self):
        self.send_keys(self.send_password_loc, '123456Aa')

    # 点击登录按钮
    click_login_button_loc = (By.XPATH, '/html/body/div[1]/div/section/section/main/div/div[2]/button')
    def click_login_button(self):
        self.click(self.click_login_button_loc)

    # 业务逻辑
    def activity_luoji_01(self):
        self.open_url('http://localhost:8081/')
        self.click_login()
        self.send_username()
        self.send_password()
        self.click_login_button()









